define(['./../initial'], function() {
    var app = angular.module('App.home');
    app.factory('zoomMap', ['$q', '$http', 'mapInstance', '$timeout',
        function($q, $http, mapInstance, $timeout) {
            return function(point, zoom) {

                var defer = $q.defer();
                var map = mapInstance.getMap();
                zoom = zoom || map.getZoom();
                // var center = map.getCenter();
                map.setView(point, zoom);
                $timeout(function() {
                    defer.resolve();
                }, 600);
                return defer.promise;
            };
        }
    ]);
});
